package cn.yy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Emp entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "emp", catalog = "phoneerp")
public class Emp implements java.io.Serializable {

	// Fields

	private Integer empid;
	private Role role;
	private Dept dept;
	private Confirm confirm;
	private User user;
	private String empName;
	private String gender;
	private Integer empPhone;
	private Date empHiredate;
	private Date empQuitdate;
	private String empLicsen;
	private Integer wagesId;
	private Set<Proof> proofs = new HashSet<Proof>(0);
	private Set<Outmatirial> outmatirials = new HashSet<Outmatirial>(0);
	private Set<Paybill> paybills = new HashSet<Paybill>(0);
	private Set<Inmatirial> inmatirials = new HashSet<Inmatirial>(0);
	private Set<Wages> wageses = new HashSet<Wages>(0);
	private Set<Recipt> recipts = new HashSet<Recipt>(0);
	private Set<Confirm> confirms = new HashSet<Confirm>(0);

	// Constructors

	/** default constructor */
	public Emp() {
	}

	/** minimal constructor */
	public Emp(Role role, Dept dept, User user, String empName, String gender,
			Integer empPhone, Date empHiredate, Date empQuitdate,
			String empLicsen, Integer wagesId) {
		this.role = role;
		this.dept = dept;
		this.user = user;
		this.empName = empName;
		this.gender = gender;
		this.empPhone = empPhone;
		this.empHiredate = empHiredate;
		this.empQuitdate = empQuitdate;
		this.empLicsen = empLicsen;
		this.wagesId = wagesId;
	}

	/** full constructor */
	public Emp(Role role, Dept dept, Confirm confirm, User user,
			String empName, String gender, Integer empPhone, Date empHiredate,
			Date empQuitdate, String empLicsen, Integer wagesId,
			Set<Proof> proofs, Set<Outmatirial> outmatirials,
			Set<Paybill> paybills, Set<Inmatirial> inmatirials,
			Set<Wages> wageses, Set<Recipt> recipts, Set<Confirm> confirms) {
		this.role = role;
		this.dept = dept;
		this.confirm = confirm;
		this.user = user;
		this.empName = empName;
		this.gender = gender;
		this.empPhone = empPhone;
		this.empHiredate = empHiredate;
		this.empQuitdate = empQuitdate;
		this.empLicsen = empLicsen;
		this.wagesId = wagesId;
		this.proofs = proofs;
		this.outmatirials = outmatirials;
		this.paybills = paybills;
		this.inmatirials = inmatirials;
		this.wageses = wageses;
		this.recipts = recipts;
		this.confirms = confirms;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "empid", unique = true, nullable = false)
	public Integer getEmpid() {
		return this.empid;
	}

	public void setEmpid(Integer empid) {
		this.empid = empid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "roleId", nullable = false)
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deptId", nullable = false)
	public Dept getDept() {
		return this.dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "confirmId")
	public Confirm getConfirm() {
		return this.confirm;
	}

	public void setConfirm(Confirm confirm) {
		this.confirm = confirm;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userID", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "empName", nullable = false, length = 10)
	public String getEmpName() {
		return this.empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	@Column(name = "gender", nullable = false, length = 3)
	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(name = "empPhone", nullable = false)
	public Integer getEmpPhone() {
		return this.empPhone;
	}

	public void setEmpPhone(Integer empPhone) {
		this.empPhone = empPhone;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "empHiredate", nullable = false, length = 10)
	public Date getEmpHiredate() {
		return this.empHiredate;
	}

	public void setEmpHiredate(Date empHiredate) {
		this.empHiredate = empHiredate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "empQuitdate", nullable = false, length = 10)
	public Date getEmpQuitdate() {
		return this.empQuitdate;
	}

	public void setEmpQuitdate(Date empQuitdate) {
		this.empQuitdate = empQuitdate;
	}

	@Column(name = "empLicsen", nullable = false, length = 20)
	public String getEmpLicsen() {
		return this.empLicsen;
	}

	public void setEmpLicsen(String empLicsen) {
		this.empLicsen = empLicsen;
	}

	@Column(name = "wagesId", nullable = false)
	public Integer getWagesId() {
		return this.wagesId;
	}

	public void setWagesId(Integer wagesId) {
		this.wagesId = wagesId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Proof> getProofs() {
		return this.proofs;
	}

	public void setProofs(Set<Proof> proofs) {
		this.proofs = proofs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Outmatirial> getOutmatirials() {
		return this.outmatirials;
	}

	public void setOutmatirials(Set<Outmatirial> outmatirials) {
		this.outmatirials = outmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Paybill> getPaybills() {
		return this.paybills;
	}

	public void setPaybills(Set<Paybill> paybills) {
		this.paybills = paybills;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Inmatirial> getInmatirials() {
		return this.inmatirials;
	}

	public void setInmatirials(Set<Inmatirial> inmatirials) {
		this.inmatirials = inmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Wages> getWageses() {
		return this.wageses;
	}

	public void setWageses(Set<Wages> wageses) {
		this.wageses = wageses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Recipt> getRecipts() {
		return this.recipts;
	}

	public void setRecipts(Set<Recipt> recipts) {
		this.recipts = recipts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emp")
	public Set<Confirm> getConfirms() {
		return this.confirms;
	}

	public void setConfirms(Set<Confirm> confirms) {
		this.confirms = confirms;
	}

}